{extend name="public/base" /}
{block name="style"}
<link rel="stylesheet" href="__PUBLIC__/admin/module3/css/my.css?v=20221110&times={:time()}" />
<link rel="stylesheet" href="__PUBLIC__/admin/material/css/iconfont.css" />
{include file="material/_ali_icon" /}
<style>
    .container,#theme-wrapper{
        max-width: 2200px;
    }
</style>
{/block}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
            <div class="fileName">
                文件名：文件文件文件
            </div>
			<button type="button" class="btn btn-warning btn-sm">保存</button>
			<!-- <button type="button" class="btn btn-warning"> <input class="checkbox check-all" type="checkbox" style="display: inline-block;margin-top: -2px;vertical-align: middle;"> 全选 </button> -->
			<button type="button" class="btn btn-primary btn-sm">另存为</button>
			<button type="button" class="btn btn-info btn-sm">打开</button>
			<button class="btn btn-danger ajax-post confirm btn-sm" url="{:url('del')}" target-form="ids">删 除</button>
		</div>
		<div class="row">
			<form method="get">
			</form>
		</div>
	</header>
	<div class="main-box-body clearfix" style="display: flex;">
		<div class="tiktok_editor">
			<div style="position: relative;height: 110px;margin-bottom: 10px;">
				<div style="position: absolute;font-size: 75px;top: 50%;left: 50%;transform: translate(-50%, -50%);display: flex;flex-direction: column;align-items: center;">
					<i class="fa fa-plus" style="color: #ccc;"></i>
					<div style="font-size: 12px!important;color: #8f8f8f;">添加模块</div>
				</div>
			</div>
			<div class="scrollContent tteditRight" style="height: 1232px;overflow-y: scroll;">
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
			</div>
		</div>
		<div class="tiktok_editor">
			<div style="position: relative;height: 110px;margin-bottom: 10px;">
				<div style="position: absolute;font-size: 75px;top: 50%;left: 50%;transform: translate(-50%, -50%);display: flex;flex-direction: column;align-items: center;">
					<i class="fa fa-plus" style="color: #e5b8c1;"></i>
					<div style="font-size: 12px!important;color: #ad8d93;">添加模块</div>
				</div>
			</div>
			<div class="scrollContent tteditRight" style="height: 1232px;overflow-y: scroll;">
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
			</div>
		</div>
		<div class="tiktok_editor">
			<div style="position: relative;height: 110px;margin-bottom: 10px;">
				<div style="position: absolute;font-size: 75px;top: 50%;left: 50%;transform: translate(-50%, -50%);display: flex;flex-direction: column;align-items: center;">
					<i class="fa fa-plus" style="color: #91acc1;"></i>
					<div style="font-size: 12px!important;color: #658399;">添加模块</div>
				</div>
			</div>
			<div class="scrollContent tteditRight" style="height: 1232px;overflow-y: scroll;">
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
			</div>
		</div>
		
		<div class="tiktok_editor tteditRight" style="width:31%;height: 1232px;overflow-y: scroll;">
			
			<div style="position: relative;height: 110px;margin-bottom: 10px;background-color: #e1e1e1;">
				<div style="position: absolute;font-size: 75px;top: 50%;left: 50%;transform: translate(-50%, -50%);display: flex;flex-direction: column;align-items: center;">
					<i class="fa fa-plus" style="color: #ccc;"></i>
					<div style="font-size: 12px!important;color: #8f8f8f;">添加模块</div>
				</div>
			</div>
			<div class="scrollContent tteditRight" style="height: 1232px;overflow-y: scroll;">
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
				<div>
					<textarea class="head" name="" id="" cols="30" rows="10"></textarea>
					<span class="title">第2132章</span>
				</div>
			</div>
		</div>
		
	</div>
</div>

<div class="modal fade" id="create-referral-link-modal">
	<div class="modal-dialog" role="document">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
			<span style="font-size: 20px;"><span id="referralname">添加</span></span>
		</div>
		<div class="modal-body">
			<div data-bind="visible: loading" class="loading-panel" style="display: none;">
				<i class="fa fa-spin fa-spinner"></i>
			</div>
			<form class="form-horizontal modelform">
			</form>
		</div>
		<div class="modal-footer">
			<button type="button" id="createreferral" class="btn btn-primary ">提交</button>
		</div>
	</div>
</div>
</div>

{include file="adsmaterialbook/_from" /}
{/block}
{block name="script"}
<script type="text/javascript">

	function goCopy(){
		copyContent($('#editContentText').val(),9999,false)
	}
	$(function() {
		$("#createreferral").on('click',function(){
			var data = $('.modelform').serializeJson();
			console.log(data);
			if ( data['book_id'] == undefined) {
				updateAlert("书名不能为空", 'danger');
				return false;
			}
			if (data['content'].length==0) {
				updateAlert("不能为空", 'danger');
				return false;
			}
			var url = "{:url('add_my')}";
			$.ajax({
				type: "POST",
				url: url,
				data:data,
				dataType: "json",
				success: function(data){
					if(data.code==1){
						updateAlert(data.msg, 'success');
						setTimeout(function() {	
							window.location.reload();
						}, 100);
					}else{
						updateAlert("添加，"+data.msg, 'danger');
					}
				},
				error : function(e){
					console.log(e.status);
					console.log(e.responseText);
				}
			})
		});
	});
	function editContent(ee){
		var id = $("#myid").val();
		var idtitle = $("#idtitle").val();
		var content = $('#editContentText').val().replace(`
	`,"\r\n");
		$.ajax({
			type: "POST",
			url: '{:url("editMyContent")}',
			data:{id:id, content:content,title:idtitle,},
			dataType: "json",
			success: function(data){
				if(data.code==1){
					updateAlert(data.msg, 'success');
					setTimeout(function() {	
						window.location.reload();
					}, 100);
				}else{
					updateAlert("添加，"+data.msg, 'danger');
				}
			},
			error : function(e){
				console.log(e.status);
				console.log(e.responseText);
			}
		})
	}

	$('.edit').click(function(){
		var ee = $(this).parent().parent().parent().siblings().children('span');
		var id = $(ee).attr("data-id");
		var title = $(ee).attr("data-title");
		let content = $(ee).html().replace(/<em>/g, '').replace(/<\/em>/g, '').replace(/<br>/g, '\r\n');
		$('.tiktok_editor .content').val(content);

		$("#idtitle").val(title);
		$("#myid").val(id);
	})
	$(function(){
		var my_id = '{:input('get.my_id', 0)}';
		if(parseInt(my_id) > 0){
			$(".edit").click()
		}
	});
</script>
{/block}